package service;

import dao.UserDao;
import po.*;

public class LoginService { // 简单判断密码是否正确
	public static boolean checkPassword(String id, String pw) {
		User u = new User();
		u.setId(id);
		UserDao.queryOneRecord(u);
		if (pw.equals(u.getPw()))
			return true;
		return false;
	}
	
	public static boolean register(String id, String pw) {
		User u = new User();
		u.setId(id);
		u.setPw(pw);
		UserDao.addOneRecord(u);
		return true;
	}
	
	public static void main(String[] args) {
		boolean code = checkPassword("123456", "123456");
		System.out.println(code);
		
	}
}
